package org.jcnc.IDEology.kernel.example;

import org.jcnc.IDEology.kernel.module.CommunicationModule;
import org.jcnc.IDEology.kernel.module.KernelModule;

public class launch {
    public static void main(String[] args) {

        // Creating a new KernelModule object
        KernelModule kernelModule = new KernelModule();

        // Registering a new submodule "JavaFXDemo" and initializing it
        kernelModule.registerSubModule("JavaFXDemo", new JavaFXDemo(), true);
        kernelModule.initSubModule("JavaFXDemo");

        // Registering a new CommunicationModule "CommModule"
        kernelModule.registerModule("CommModule", CommunicationModule.class, true);

        // Getting the CommunicationModule "CommModule"
        CommunicationModule commModule = (CommunicationModule) kernelModule.getSubModule("CommModule");

        // Adding a new communication partner "JavaFXDemo"
        commModule.addCommunicationPartner("JavaFXDemo", new JavaFXDemo());

        // Sending a message to "JavaFXDemo"
        commModule.sendMessage("JavaFXDemo", "Hello, JavaFXDemo!\nI am kernelModule!!!");

        // Getting all registered modules
        kernelModule.getAllRegisteredModules();
    }
}
